<%@ page language="java" import="java.util.*,com.ternnetwork.cms.model.content.Content,com.ternnetwork.cms.enums.ContentStatus" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    <c:import url="/WEB-INF/view/include/color_admin_header.jsp"/>
    <link rel="stylesheet" href="<c:url value='/plugin/ztree/css/zTreeStyle/zTreeStyle.css' />" type="text/css">
    <link rel="stylesheet" href="<c:url value='/plugin/kindeditor/themes/default/default.css' />" />
	<link rel="stylesheet" href="<c:url value='/plugin/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css' />">
    <link href="<c:url value='/plugin/select2/dist/css/select2.min.css'/>" rel="stylesheet" />
 
  <script type="text/javascript">
  var userPath='<%=basePath%>';
  </script>
    <style type="text/css">
           .ke-icon-carousel {
				background-image: url(<c:url value='/resources/images/icons/Images_16px_1081459.png' />);
				width: 16px;
				height: 16px;
			}
  </style>
 </head>
   <body >
 
<div class="container-fluid" id="content_container">
	
         <input type="hidden" value="${t.channel.site.id}" id="siteId" >
         
	        <br>
	        <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">栏目</span>
             <input type="text" readonly value="${t.channel.nameZh}" id="channel" class="form-control" placeholder="栏目" aria-describedby="sizing-addon2" >
              <input type="hidden" name="id"  value="${t.id}"/>
             <input type="hidden" name="channel.id" value="${t.channel.id}" id="channelId" />
             </div>
            </div>
           
            <div class="row-fluid" id="channelMenuContent">
             <div class="col-md-offset-2 col-md-10 input-group">
              <ul id="channelTree" class="ztree" style="margin-top:0; width:160px;"></ul>
             </div>
           </div>
            <br>
             <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">模板</span>
             <select class="form-control" name="template" >
             <option value="">请选择模板</option>
              <c:forEach var="item" items="${fileNameList}" varStatus="status">
                  <option <c:if test='${t.template==item}'>selected="selected"</c:if>  value="${item}">${item}</option>
              </c:forEach>
             </select>
             </div>
            </div>
            <br>
           <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">标题</span>
             <input type="text" name="title" class="form-control" value="${t.title}" placeholder="标题" aria-describedby="sizing-addon2" >
             </div>
          </div>
           <br>
           <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">来源</span>
             <input type="text" name="contentFrom" class="form-control" value="${t.contentFrom}" placeholder="来源" aria-describedby="sizing-addon2" >
             </div>
          </div>
            <br>
            <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">摘要</span>
             <input type="text" name="subTitle" value="${t.subTitle}" class="form-control" placeholder="摘要" aria-describedby="sizing-addon2" >
             </div>
          </div>
            <br>
          <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">作者</span>
             <input type="text" name="author" value="${t.author}" class="form-control" placeholder="作者" aria-describedby="sizing-addon2" >
             </div>
          </div>
           <br>
          <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">有效期起</span>
             <input type="text" name="startTime" value="<fmt:formatDate value="${t.startTime}" pattern="yyyy-MM-dd HH:MM:SS" />" class="form-control form_datetime"  placeholder="有效期起" aria-describedby="sizing-addon2" >
             </div>
          </div>
             <br>
          <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">有效期止</span>
             <input type="text" name="endTime" value="<fmt:formatDate value="${t.endTime}" pattern="yyyy-MM-dd HH:MM:SS" />" class="form-control form_datetime" placeholder="有效期止" aria-describedby="sizing-addon2" >
             </div>
          </div>
            <br>
            <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">类别</span>
             <input type="text" readonly value="${t.contentCategory.nameZh}" id="contentCategory" class="form-control" placeholder="类别" aria-describedby="sizing-addon2" >
             <input type="hidden" value="${t.contentCategory.id}" name="contentCategory.id" id="contentCategoryId" />
             </div>
            </div>
             
           <div class="row-fluid" id="menuContent">
             <div class="col-md-offset-2 col-md-10 input-group">
              <ul id="treeDemo" class="ztree" style="margin-top:0; width:160px;"></ul>
             </div>
           </div>
             <br>
            <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">是否可评论</span>
             <select class="form-control" name="commentAble">
           <option value="false" <c:if test='${t.commentAble==false}'>selected="selected"</c:if> >否</option>
           <option value="true" <c:if test='${t.commentAble==true}'>selected="selected"</c:if> >是</option>
             </select>
             </div>
            </div>
            <br>
             <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">状态</span>
             <select class="form-control" name="status" >
                <%
                Content c=(Content)request.getAttribute("t");
                for(ContentStatus t: ContentStatus.values()){
                 if(c.getStatus().equals(t)){
                	   out.println("<option selected=\"selected\" value=\""+t.name()+"\">"+t.getName()+"</option>");
                 }else{
                 	   out.println("<option  value=\""+t.name()+"\">"+t.getName()+"</option>");
                       
                 }
	  		  
  	           }
               %>
             </select>
             </div>
            </div>
           <br>
             <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">上一篇</span>
             <select id="preContentSelect"  class="form-control selectpicker" data-size="20" data-live-search="true" data-style="btn-white">
                    <option value="" >请选译</option>
                      <c:if test='${t.preContent!=null}'>
                    <option value="${t.preContent.id}" selected="selected" >${t.preContent.title}</option>
                    </c:if>
              </select>
             </div>
            </div>
             <br>
             <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">下一篇</span>
             <select id="nextContentSelect"  class="form-control selectpicker" data-size="20" data-live-search="true" data-style="btn-white">
                    <option value="" >请选译</option>
                    <c:if test='${t.nextContent!=null}'>
                    <option value="${t.nextContent.id}" selected="selected" >${t.nextContent.title}</option>
                    </c:if>
                    
              </select>
             </div>
            </div>
          <br>
           <div class="row-fluid">
             <div class="col-md-12 input-group">
             <span class="input-group-addon" id="sizing-addon1">内容</span>
            <textarea name="content" id="contenteditor" cols="100" rows="8" style="width:100%;height:300px;visibility:hidden;">${t.contentString}</textarea>
             </div>
           </div>
           <br>
           <div class="row-fluid">
             <div class="col-md-5 input-group">
             <span class="input-group-addon" id="sizing-addon1">操作</span>
             <button type="button" class="btn btn-success" id="btn_save">保存</button>
             </div>
           </div>
    
	
	
</div>




  <div class="modal fade " role="dialog" id="alertModal" aria-labelledby="gridSystemModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" >警告</h4>
      </div>
      <div class="modal-body">
      <p>
	  </p>
      </div>
      <div class="modal-footer">
       <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<div class="modal fade " role="dialog" id="carouselModal" aria-labelledby="gridSystemModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" >请选择轮播</h4>
      </div>
      <div class="modal-body">
       <div class="container-fluid">
         <div class="row">
           <div class="col-md-12 input-group">
              <select id="carouseSelect" class="form-control selectpicker" data-size="20" data-live-search="true" data-style="btn-white">
                    <option value="" >请选译</option>
              </select>
           </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
       <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="carouselManage();">轮播管理</button>
       <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="insertCarouselSelect();">确定</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
 
    <c:import url="/WEB-INF/view/include/color_admin_footer.jsp"/>
   <script src="<c:url value='/plugin/ztree/js/jquery.ztree.core-3.5.js' />"></script>
  	<script charset="utf-8" src="<c:url value='/plugin/kindeditor/kindeditor.js' />"></script>
	<script charset="utf-8" src="<c:url value='/plugin/kindeditor/lang/zh_CN.js' />"></script>
    <script src="<c:url value='/resources/js/commons-util.js' />"></script>
    <script src="<c:url value='/plugin/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js' />"></script>
   
    <script src="<c:url value='/plugin/select2/dist/js/select2.min.js' />"></script>
    <script src="<c:url value='/plugin/select2/dist/js/i18n/zh-CN.js' />"></script>
    <script src="<c:url value='/plugin/blockui/jquery.blockUI.js' />"></script>
    <script src="<c:url value='/resources/js/cms/carousel/carousel_select2.js' />"></script>
    <script src="<c:url value='/resources/js/cms/content/content_select2.js' />"></script>
    <script src="<c:url value='/resources/js/cms/content/content_editor.js' />"></script>
    <script src="<c:url value='/resources/js/cms/content/content_edit.js' />"></script>
   </body>
</html>
